package com.woniu.defecttracking;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@MapperScan("com.woniu.defecttracking.mapper")
public class DefectTrackingApplication {

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        PaginationInnerInterceptor pi = new PaginationInnerInterceptor(DbType.MYSQL);
        pi.setOverflow(true);
        interceptor.addInnerInterceptor(pi);
        return interceptor;
    }

    public static void main(String[] args) {
        SpringApplication.run(DefectTrackingApplication.class, args);
    }

}
